<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
</head>
<body>
<div th:replace="fragments/header :: header">...</div>


<div th:if="${message}">
    <h2 th:text="${message}"/>
</div>

<div>
    <form method="POST" enctype="multipart/form-data" action="/">
        <input type="file" name="file"/>
        <input type="submit" value="Upload"/>
    </form>
</div>

<div>
    <table border="1">
    <thead>
    <tr>
        <td>Name</td>
        <td>ID</td>
        <td>contentType</td>
        <td>size</td>
        <td>uploadDate</td>
        <td>md5</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    <tr th:if="${files.size()} eq 0">
        <td colspan="3">没有文件信息！！</td>
    </tr>
    <tr th:each="file : ${files}">
        <td><a th:href="${file.id}" th:text="${file.name}" /></td>
        <td th:text="${file.id}" ></td>
        <td th:text="${file.contentType}" ></td>
        <td th:text="${file.size}" ></td>
        <td th:text="${file.uploadDate}" ></td>
        <td th:text="${file.md5}" ></td>
        <td >
            <a th:href="'/view/'+${file.id}" target="_blank">预览</a>
        </td>
    </tr>
    </tbody>
</table>
</div>

<div th:replace="fragments/footer :: footer">...</div>
</body>
</html>
